package com.snoopy.gas1.controller;

import com.snoopy.gas1.entity.Employee_info;
import com.snoopy.gas1.entity.Financial_record;
import com.snoopy.gas1.service.Employee_infoService;
import com.snoopy.gas1.service.Financial_recordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Controller
@RequestMapping("financial_record")
public class Financial_recordController {
    @Autowired
    private Financial_recordService financialRecordService;  // 注入员工服务

    @GetMapping("/list")
    public String list(Model model){
        List<Financial_record> financialRecordList = financialRecordService.lists();  // 获取员工列表
        model.addAttribute("financialLists", financialRecordList);  // 修正：模型属性名为employeeLists
        return "financial_record/list";
    }
}
